home *** CD-ROM | disk | FTP | other *** search
- /*
- Copyright © 1988,1989,1990 by Succinct Systems
-
- 433 Huronview
- Ann Arbor, MI 48103
- (313) 663-4903
-
- File: Compatibility.h
- Model: THINK C 4.0, MPW C 3.0
-
- ABSTRACT:
- Standard inter-development compatibility definitions.
-
- NOTES:
- ---
-
- KNOWN BUGS:
- ---
-
- HISTORY:
- DAS 10-Jul-88 created this file (David A. Surovell)
- DAS 14-Jul-89 amended for new Think 4.0 support for new ANSI standard
- DAS 04-Feb-90 added Think --> MPW conversion support
- added C++ object syntax stub supports
- upgraded string support
- DAS 05-Apr-90 moved C++ support into <CPlusCovers.h> and #included
- DAS 16-Apr-90 added "const" dummy definition
- */
-
- #define _H_Compatibility
-
-
- #ifdef THINK_C /* if Think C currently in use */
-
- /* some compilers require “return()” in void functions */
- #ifndef RETURN
- #define RETURN return
- #endif RETURN
-
- /* some compilers can’t pass Point structure variables */
- /* without casting them to type “long” */
- #ifndef pass
- #define pass(A) (A)
- #endif pass
-
- /* some compilers pass Point variables to Toolbox routines */
- /* by reference rather than by value */
- #ifndef ptpass
- #define ptpass(A) (A)
- #endif ptpass
-
- /* some compilers define strings as struct-based data types */
- /* sign extension problems are common, too */
- #ifndef USTRLEN
- #define USTRLEN(A) ((unsigned)((char*)(A)[0]))
- #endif USTRLEN
-
- /* A lack of ANSI can be painful, especially since MPW uses this construct heavily */
- #ifndef const
- #define const /**/
- #endif const
-
- /* these will be language features someday soon, we hope */
- #include <CPlusCovers.h>
-
- #endif THINK_C
-
-
- #ifdef _MPWC_ /* if MPW C is currently in use */
-
- #ifndef RETURN
- #define RETURN return
- #endif RETURN
-
- #ifndef pass
- #define pass(A) (A)
- #endif pass
-
- #ifndef ptpass
- #define ptpass(A) (&(A))
- #endif ptpass
-
- #ifndef USTRLEN
- #define USTRLEN(A) ((unsigned)((char*)(A)[0]))
- #endif USTRLEN
-
- /*
- ** Note: it used to be this, in v2.0 compiler!
- **
- #define USTRLEN(A) ((unsigned)((A).length))
- */
- #endif _MPWC_
-
-
- #ifdef _AZTECC_ /* if Aztec C is currently in use */
-
- #ifndef RETURN
- #define RETURN return()
- #endif RETURN
-
- #ifndef ptpass
- #define ptpass(A) (*((long*)&(A)))
- #endif ptpass
-
- #ifndef USTRLEN
- #define USTRLEN(A) ((unsigned)(*((Ptr)(&(A)))))
- #endif USTRLEN
-
- #endif _AZTECC_
-
-
- /* generic and language-independent */
- #ifndef NULL
- #define NULL 0L
- #endif NULL
-
- #ifndef TRUE
- #define TRUE ((Boolean)1)
- #define FALSE ((Boolean)0)
- #endif TRUE
-
-